//
//  Team9BaseView.m
//  Team9Project
//
//  Created by 朱嘉祺 on 15/10/12.
//  Copyright © 2015年 apple. All rights reserved.
//

#import "Team9BaseView.h"
#import "Team9Header.h"

@interface Team9BaseView ()



@end

@implementation Team9BaseView

#pragma mark 夜间模式
- (instancetype)initWithType:(ViewType)type{
    self = [super init];
    self.Type = type;
    if (self) {
        [[NSNotificationCenter defaultCenter]addObserver:self selector:@selector(changecolor) name:@"changecolor" object:nil];
        [self changecolor];
    }
    return self;
}

- (instancetype)init{
    return [self initWithType:ViewTypeWhiteBlack];
}
- (void)changecolor{
    if ([Team9EveningType shareEvening].eveningFailling) {
        switch (self.Type) {
            case ViewTypeWhiteBlack:
                self.backgroundColor = [UIColor blackColor];
                break;
            case ViewTYpeLight:
                self.backgroundColor = [UIColor colorWithWhite:0.15 alpha:1];
            default:
                break;
        }
        
    } else {
        switch (self.Type) {
            case ViewTypeWhiteBlack:
                self.backgroundColor = [UIColor whiteColor];
                break;
            case ViewTYpeLight:
                self.backgroundColor = [UIColor colorWithWhite:0.95 alpha:1];
            default:
                break;
        }
    }
}
- (void)dealloc{
    [[NSNotificationCenter defaultCenter]removeObserver:self];
}
@end
